<style>
table td {
	vertical-align: top;
	border-bottom: 1px solid #999;
}
input,textarea{
	width:100px;
}
</style>


<div class="div div-plain">
	<?php echo empty($curr_category)? "":CHtml::link("返回上一级",array("category/admin","id"=>$curr_category->parent_id),array("class"=>"headerLink left"))?>
	<h1>分类管理 <?php echo empty($curr_category)?"":" - $curr_category->title"?></h1>
	<p><a href='http://twitter.github.com/bootstrap/base-css.html'>图标看这里</a></p>
	<br />
	<?php  echo CHtml::link("新建分类",array("category/add","id"=> empty($curr_category)?"0":$curr_category->id),array("class"=>"btn"));?>

	<?php echo CHtml::form('','post',array('enctype'=>'multipart/form-data',"data-ajax"=>"false")); ?>

	<?php foreach($categories as $category):?>
	<div class='span2 alert alert-warn'>
		<?php echo CHtml::activeHiddenField($category,"[{$category->id}]id"); ?>
		<?php echo CHtml::activeHiddenField($category,"[{$category->id}]parent_id"); ?>
		<table>
			<tr>
				<th>Title:</th>
				<td><?php echo CHtml::activeTextField($category,"[{$category->id}]title",array('size'=>4,'maxlength'=>30,"value"=>$category->title)); ?>
				</td>
			</tr>
			<tr>
				<th>Seq:</th>
				<td><?php echo CHtml::activeTextField($category,"[{$category->id}]seq",array('size'=>4,"value"=>$category->seq)); ?>
				</td>
			</tr>
			
			<tr>
				<th>Icon:</th>
				<td><?php echo CHtml::activeTextField($category,"[{$category->id}]description",array('size'=>4,"value"=>$category->description)); ?>
				</td>
			</tr>
			<tr>
				<th></th>
				<td><?php  echo CHtml::link("删除",array("category/delete","id"=>$category->id),array("class"=>'btn'))?>
				<?php  echo CHtml::link("查看",array("category/admin","id"=>$category->id),array("class"=>'btn'))?>
				</td>
			</tr>
		</table>

	</div>
	<?php endforeach;?>
	<div style='clear: both'></div>
	<?php echo CHtml::submitButton('确定',array("class"=>'btn')); ?>
	<?php echo CHtml::endForm(); ?>
</div>
